home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / XML Utilities / Professional Programmer XSL IDE / Xselerator25.msi / Data.Cab / F45334_xsCondittionalStringGeneration.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2001-07-13  |  693 b   |  24 lines

  1. <xsl:stylesheet version="1.0"
  2. xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3.   <xsl:output method="text" />
  4.  
  5.   <xsl:template match="/">Mary:
  6.   <xsl:call-template name="whoIs">
  7.     <xsl:with-param name="aGirl" select="'Mary'" />
  8.   </xsl:call-template>
  9.  
  10. Ann:
  11.   <xsl:call-template name="whoIs">
  12.     <xsl:with-param name="aGirl" select="'Ann'" />
  13.   </xsl:call-template>
  14.   </xsl:template>
  15.  
  16.   <xsl:template name="whoIs">
  17.     <xsl:param name="aGirl" select="someName" />
  18.  
  19.     <xsl:value-of
  20.     select="concat(substring('My girlfriend', 1 div ($aGirl = 'Mary')),
  21.             substring('Some other girl', 1 div not(($aGirl = 'Mary'))))" />
  22.   </xsl:template>
  23. </xsl:stylesheet>
  24.